import React from 'react'
import { Button } from '@material-ui/core';
import marked from 'marked'

function App() {
  return <Button color="primary">Hello World</Button>;
}


// Set options
// `highlight` example uses `highlight.js`
marked.setOptions({
  renderer: new marked.Renderer(),
  highlight: function(code, language) {
    const hljs = require('highlight.js');
    const validLanguage = hljs.getLanguage(language) ? language : 'plaintext';
    return hljs.highlight(validLanguage, code).value;
  },
  baseUrl: 'src/',
  pedantic: false,
  gfm: true,
  breaks: true,
  sanitize: false,
  smartLists: true,
  smartypants: false,
  xhtml: false
});

export default class Post extends React.Component {
  render () {
    return (
      <div>
        <App />
        <h1>xxxx</h1>
        <p>xxxx</p>
        <div dangerouslySetInnerHTML={{__html: marked(require('fs').readFileSync("./a/index.md", 'utf8'))}}></div>
      </div>
    )
  }
}
